{template header}
{template nav}

<div class="sidnav">您的位置：&nbsp;<a href="{url index.php?m=car}" target="_blank" >首页</a>&nbsp;&gt;&nbsp;
  <a href="{url index.php?m=car&f=buy}" target="_blank" >我要买车</a>&nbsp;&gt;&nbsp;
  {$data['title']}
</div>
<div class="area">
	<div class="left1">
    	<div class="lboxcon1 clear">
    	
        	<div class="tit"><h2>{$data['title']}</h2>
	        	<div class="bqcon">
		        	
                    {if $data['status']}<span class="bq02" title="审核通过">审</span>{/if}
                    {if $data['shopid']}<span class="bq03" title="商家车源">商</span>{/if}                
                    
        	  </div>
        	</div>
            <div class="lfocus">
            	<div class="vgcon">
	            	<div class="vgbox" id="fzxa-big-img">
	            		<a href="javascript:;" class="abox">
	            			
	            		</a>
	            	</div>
            	</div>
                <div class="lfocustxt">
                	<a class="preno" id="fzxa-btn-left" href="javascript:;"></a>
                    <div class="sidpiccon" id="fzxa-lit-wrap">
                    	<ul id="fzxa-lit-img">
                        	
                        </ul>
                    </div>
                    <a class="next" id="fzxa-btn-right" href="javascript:;"></a>
                </div>
            </div>
            <div class="lboxtxt">
                <table class="tb3" width="100%" cellspacing="1" cellpadding="6" border="0" bgcolor="#C1C1C1">
                  <tbody><tr>
                    <td width="69" height="28" bgcolor="#F6F6F6">车辆类别：</td>
                    <td width="101" bgcolor="#FFFFFF">{$data['catename']}</td>
                    <td width="69" bgcolor="#F6F6F6">变速箱：</td>
                    <td width="103" bgcolor="#FFFFFF">{$biansu[$data['biansu']]}</td>
                  </tr>
                  <tr>
                    <td height="28" bgcolor="#F6F6F6">车辆颜色：</td>
                    <td bgcolor="#FFFFFF">{$data['color']}</td>
                    <td bgcolor="#F6F6F6">排气量：</td>
                    <td bgcolor="#FFFFFF">{$data['pailiang']}升</td>
                  </tr>
                  <tr>
                    <td height="28" bgcolor="#F6F6F6">上牌日期：</td>
                    <td bgcolor="#FFFFFF">{gdate('Y年m月',$data['shangpai'])}</td>
                    <td bgcolor="#F6F6F6">行驶里程：</td>
                    <td bgcolor="#FFFFFF">{$data['licheng']}万公里</td>
                  </tr>
                  <tr>
                    <td height="28" bgcolor="#F6F6F6">车主姓名：</td>
                    <td bgcolor="#FFFFFF" colspan="3">{$data['contact']}</td>
                    </tr>
                 
                  <tr>
                    <td height="28" bgcolor="#F6F6F6">联系电话：</td>
                    <td bgcolor="#FFFFFF" colspan="3">{$data['phone']}</td>
                    </tr>
                    
                    <tr>
                    <td height="28" bgcolor="#F6F6F6">预售价：</td>
                    <td bgcolor="#FFFFFF"><span class="red"><em id="sale-price">{$data['price']}</em> 万元</span></td>
                    <td bgcolor="#F6F6F6">浏览量：</td>
                    <td bgcolor="#FFFFFF">{$data['views']} 次</td>
                    </tr>
                </tbody></table>
                <p class="p5" style="display:none;"><a href="javascript:void(0)" onclick="addFavorite()" class="scico">收藏此车</a>&nbsp;&nbsp;</p>
            </div>
        </div>
        <div class="lboxcon">
        	<div class="tit">
            	<ul class="tab">
        	<li class="cur"><a  href="#ck">车辆详细信息</a></li>
            <li style="display:none;"><a  href="#sj">商家信息</a></li>
        </ul>
            </div>
            <div class="lbox1">
            	<div class="lboxxqcon1">
                	<table class="cktable">
                    	<tr><th>车型名称：</th><td >{$data['brand']}</td><th>车辆类别：</th><td>{$data['catename']}</td> 
                    	<tr><th>车辆颜色：</th><td >{$data['color']}</td><th>排气量：</th><td>{$data['pailiang']}升</td></tr>
                        <tr><th>变速箱：</th><td>{$biansu[$data['biansu']]}</td><th>表显里程：</th><td>{$data['licheng']}万公里</td></tr>
                      
                        <tr><th>上牌日期：</th><td>{gdate('Y年m月',$data['shangpai'])}</td><th>发布日期：</th><td>{gdate('Y-m-d H:i:s',$data['created'])}</td></tr>
                        <tr><th>配置详情：</th><td colspan="3">{$data['description']}</td></tr> 
                        <tr><th>车况介绍：</th><td colspan="3">{$data['jianjie']}</td></tr> 
                        
 
                    </table>

                    <span id="showimg">
                    {loop $files $v}
                     <img src="{echo DATA_DIR}files/{$v['filepath']}" onload="if(this.width > 650) this.width = 650"  />
					{/loop}
                    </span>
                    
                </div>
       
       
                
            </div>
        </div>
    </div>
    <div class="right0">
		{php $brandcars=getcar_by_brand($data['bid']);}
        <div class="rboxcon">
        	<div class="rtit">
                	<h2>同车系其他车源</h2>
          </div>
             <ul class="rlist5">
             {loop $brandcars $v}
             <li><div class="vgcon">
	                	<div class="vgbox">
		                	<a class="abox" href="{url index.php?m=car&f=buy&id=$v[id]}" target="_blank">
                		
                    	<img width="120" height="80" src="{echo DATA_DIR}files/{$v['picture']}" alt="{$v['title']}" title="{$v['title']}" class="boxc">
                    	
		                	</a>
	                	</div>
                	</div>
                	<p>
	                	<a title="{$v['title']}" class="carmoda" href="{url index.php?m=car&f=buy&id=$v[id]}" target="_blank">{$v['title']}</a><br>
	                	<span class="red">{$v['price']}万元</span><br>
	                	                	</p>
               	</li>
             {/loop}
              
           	
             </ul>
      </div>
      {php $catecars=getcar_by_category($data['cid'],$data[id]);}
      <div class="rboxcon">
        	<div class="rtit">
                	<h2>同类别其他车源</h2>
          </div>
             <ul class="rlist5">
             {loop $catecars $v}
             <li><div class="vgcon">
	                	<div class="vgbox">
		                	<a class="abox" href="{url index.php?m=car&f=buy&id=$v[id]}" target="_blank">
                		
                    	<img width="120" height="80" src="{echo DATA_DIR}files/{$v['picture']}" alt="{$v['title']}" title="{$v['title']}" class="boxc">
                    	
		                	</a>
	                	</div>
                	</div>
                	<p>
	                	<a title="{$v['title']}" class="carmoda" href="{url index.php?m=car&f=buy&id=$v[id]}" target="_blank">{$v['title']}</a><br>
	                	<span class="red">{$v['price']}万元</span><br>
	                	                	</p>
               	</li>
             {/loop}
             </ul>
      </div>
 
         
    	  
          <div class="rboxcon" id="lookedCar">
         </div>
      <script>
	         var cookieCar = getCookie("cookieCar");
	         if(cookieCar){
				 var cookieCarJson = eval("("+cookieCar+")");
				 var lookedCarHtml = "";
				 var jsonCar = "";
				 if(cookieCarJson.length > 0){
					 lookedCarHtml = "<div class=\"rtit\"><h2>您浏览过的车源</h2></div> <ul class=\"rlist3\">";
					 for(var i = 0;i<cookieCarJson.length;i++){
						jsonCar = cookieCarJson[i];
						if(jsonCar){
							lookedCarHtml += "<li><a target=\"_blank\" href=\""+jsonCar.url+"\">"+jsonCar.name+"</a></li>";
						}
					 }
					 lookedCarHtml += "</ul></div>";
					document.getElementById("lookedCar").innerHTML = lookedCarHtml;
				 }
	         }else{
	        	 document.getElementById("lookedCar").style.display = "none";
	         }
         </script>
    </div>
</div>

<script type="text/javascript" src="{echo THEME_URL}js/show.js"></script>    
<script>
function addFavorite(){
	var ucarid = '24';
	$.ajax({url:rooturl+'common/addFavorite.php?id='+ucarid, type:"get", success:function (data) {
		var dataObj = eval("(" + data + ")");
		if(dataObj.result == "1"){
			alert(dataObj.msg);
		}else{
			alert(dataObj.msg);
		}
	}});
}

try{
	var car = new Object();
	var carArr = new Array();
	car.name = "{$data['title']}";
	car.url = "{url index.php?m=car&f=buy&id=$data[id]}";
	carArr.push(car);
	var cookieCar = getCookie("cookieCar");
	if(cookieCar){
		var cookieCarJson = eval("("+cookieCar+")");
					
		var jsonCar = "";
		for(var i = 0;i<cookieCarJson.length;i++){
			jsonCar = cookieCarJson[i];
			if(jsonCar && jsonCar.name != car.name && jsonCar.url != car.url && carArr.length < 5){
				carArr.push(jsonCar);
			}
		}
	}
	var json = JSON.stringify(carArr);
	setCookie("cookieCar",json);
}catch(e){}
			
			//菜单定位
		
			var picLitUrlArr = new Array();
			var picBigUrlArr = new Array();
			{loop $files $v}
			picLitUrlArr.push("{echo DATA_DIR}files/{$v['filepath']}");
			picBigUrlArr.push("{echo DATA_DIR}files/{$v['filepath']}");
			{/loop}
			//焦点图
			var focusSetting = {
				'imgLitSource' : picLitUrlArr,
				'imgBigSource' : picBigUrlArr
			};
			ScBase.focus(focusSetting);				
</script>
                
{template footer}